package com.dorm.service;

import com.dorm.entity.HygieneRecord;
import com.dorm.mapper.HygieneRecordMapper;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class HygieneRecordService {
    private final HygieneRecordMapper hygieneRecordMapper;

    public HygieneRecordService(HygieneRecordMapper hygieneRecordMapper) {
        this.hygieneRecordMapper = hygieneRecordMapper;
    }

    public List<HygieneRecord> getRecordsByRoom(Long roomId) {
        return hygieneRecordMapper.findByRoomId(roomId);
    }

    public HygieneRecord createRecord(HygieneRecord record) {
        hygieneRecordMapper.insert(record);
        return record;
    }

    public void deleteRecord(Long id) {
        hygieneRecordMapper.deleteById(id);
    }
} 